package com.cjyd.hrjb.event;

import cn.hutool.cron.CronUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextClosedEvent;

/**
 * Created fei wo by 2020/4/5
 */
@Slf4j
public class ApplicationCloseListener implements ApplicationListener<ContextClosedEvent> {

    @Override
    public void onApplicationEvent(ContextClosedEvent event) {
        log.warn("Hrjb程序已停止");
        // 停止定时任务
        CronUtil.stop();
    }
}
